<template>
    <div>
        <i class="el-icon-arrow-left back" @click="goBack()"></i>
        <el-row class="personnelInfo" v-for="(n,index) in Resumes" :key="index">
            <el-col :span="12">
                <div class="left">
                    <h2>{{n.username}}</h2>
                    <div>
                        <!-- <label class="salary">在校/应届生</label> -->
                        <label>邮箱：{{n.email}}</label>
                        <!-- <label>收到时间：{{n.gmtCreate}}</label> -->
                    </div>
                </div>
            </el-col>
            <el-col :span="12">
                <div class="left">
                    <h2>电话：{{n.phoneNumber}}</h2>
                    <div>
                        <label @click="openDetail(n.id)"><i class="el-icon-message"></i>  查看详情</label>
                        <label @click="deleteIt()"><i class="el-icon-delete"></i>  删除</label>
                    </div>
                </div>
            </el-col>
        </el-row>
    </div>
</template>

<style lang="less" scoped>
.back{
    font-size: 20px;
    margin-left: 10px;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    // border: 1px solid rgb(48, 48, 48);
    border-radius: 50%;
}
.personnelInfo{
     background-color: #eff0f5;
     margin-bottom: 20px;
     border: none;
    .el-col{
        padding:  0 40px;
        h2{
                color: #3db3b7;
                margin: 0;
            }
        label{
            margin-right: 30px;
            opacity: 0.7;
        }
        .left{
            div{
                margin-top: -15px;
            }
        }
    }
}
</style>

<script>
export default {
    data(){
       return{
           jianliID:'',
           Resumes:[]
       }
    },
    methods:{
        //点击查看收到的【简历详情】
        openDetail(id){
            this.bus.$emit('send',id)
            this.$router.push("/ResumeDetail")
        },
        deleteIt(){
         this.$confirm('是否删除该简历?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          console.log("成功");
          this.$message({
            type: 'success',
            message: '删除成功!'
          });
        }).catch(() => {
          console.log("取消");
          this.$message({
            type: 'info',
            message: '已取消删除'
          });          
        });
        },
        goBack(){
            this.$router.push("./existingRecruitment")
          },
        getInfomation(){
                depot.get({
                url: '/empservice/link/getRecruitmentByRid/'+this.jianliID,
                data:{
                    "Rid": this.jianliID,
                },
                cb: (res)=> {
                   console.log(res);
                   this.Resumes = res.data.list
                }
                })
        }
        },
    //生命钩子：
    created() {
        // console.log("ViewResume创建时");
        },
    beforeCreate() {
            //    创建完成时
        // console.log("ViewResume 创建完成时");
        },
    mounted:function () {   
        //自动触发写入的函数
        this.bus.$on('sendId',(res)=>{
            // console.log(res);
            this.jianliID = res
        })
        this.getInfomation()
    },
    activated(){
        this.getInfomation()
            // console.log('实例被激活时使用，用于重复激活一个实例的时候')
    },
    deactivated(){
            // console.log('实例没有被激活时')
    },
    destroyed(){
       
    },
    beforeDestroy() {
        this.bus.$off('sendId')
    },
}
</script>